<template>
  <div>
    <img :src="food.imgUrl" style="width:100%">
    <p>{{food.name}}</p>
  </div>
</template>

<script lang="ts">
import { Component, Vue } from "vue-property-decorator";
import { IFood } from "@/interfaces/foodsinterface";
@Component
export default class Info extends Vue {
  food: IFood = {};

  created(): void {
    this.food = this.$route.query;
    console.log(this.$route.query); //指向当前路由对象
  }
}
</script>

<style scoped>
</style>